package com.araaya.eslimsmobile;

import java.io.InputStream;

import org.json.JSONException;
import org.json.JSONObject;

import com.araaya.eslimsmobile.util.ElandConstant;
import com.araaya.eslimsmobile.web.WebCaller;

import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.widget.Toast;

public class JavaScriptInterface {
	Context mContext;

	/** Instantiate the interface and set the context */
	public JavaScriptInterface(Context c) {
		mContext = c;
	}

	/** Show a toast from the web page */
	public void getWebData(String androidData,String UserName) {
		// Toast.makeText(mContext, androidData, Toast.LENGTH_SHORT).show();
		long landId = Long.parseLong(androidData);
		/*
		 * String URL=ElandConstant.Mobile_URL+"maction=kmlSave&landId=" +
		 * landId + "&userName=orlm&password=password"; try { //Log.d("JSON",
		 * sendInvitation(URL).getString("res")); Toast.makeText(mContext,
		 * sendInvitation(URL), Toast.LENGTH_SHORT).show(); } catch (Exception
		 * e) { Log.d("Exception",e.getMessage()); }
		 */
		Intent intent = (Intent) new Intent(mContext, KmlHome.class);
		intent.putExtra("landId", landId);
		intent.putExtra("userName", UserName);
		intent.putExtra("web", true);
		mContext.startActivity(intent);
	}

	/*public void exitWebApplication() {
		Intent intent = (Intent) new Intent(mContext, ElandMobileHome.class);
		mContext.startActivity(intent);

	}*/

}
